var usernameInput = document.querySelector('.username');
var passwordInput = document.querySelector('.password');
var loginBtn = document.querySelector('.login');

loginBtn.addEventListener('click',function() {
    var username = usernameInput.value;
    var password = passwordInput.value;
    myAjax('POST','/login',{username,password}).then((data) => {
        alert(data);
        location.href = '/admin';
    })
})